<template>

    <el-header>
      <div style="width:700px" class="logo">
        <img src alt />
        <span></span>
      </div>
      <div>
        <el-button type="info">
          <i class="el-icon-user"></i>
          {{ user.userAccount }}
        </el-button>
        <el-button @click="logout" style="margin-left:0px" type="info">
          <i class="el-icon-moon-night"></i>退出登录
        </el-button>
      </div>
    </el-header>
</template>

<script>
export default {
  data() {
    return {
      user: window.sessionStorage.getItem('user') ? JSON.parse(window.sessionStorage.getItem('user')) : '没得名字',
      api: {
        logout: this.$api.logout
      }

    }
  },
  methods: {}
}
</script>
<style lang='less' scoped>
.el-header,
.el-footer {
  background-color: #373d41;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-right: 5px;
  > div {
    width: 20%;
  }
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #E9EEF3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body>.el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

.aside_home {
  background-color:#262626;
  color:#bbb;
}

.root_home,
.el-container {
  height: 100%
}

</style>
